package cn.inspur.spark;

import com.huaban.analysis.jieba.JiebaSegmenter;
import org.apache.commons.lang.StringUtils;
import java.util.List;
import java.util.regex.Pattern;
import java.util.stream.Collectors;


public class jb {
    public static String analysis(String prefix,String sentence){
        JiebaSegmenter jiebaSegmenter = new JiebaSegmenter();
        List<String> list= jiebaSegmenter.sentenceProcess(sentence.replaceAll("[，,。”“ ！：（）就；、了呢吧啊没这和用买到挺给多真比说点它在？的一个直才送下+刚有&们看更拿不够倍哈我等也很还是都但]",""));
        List<String> list2=list.stream().map(s->prefix+"|"+s).collect(Collectors.toList());
        return StringUtils.join(list2.toArray(),",");
    }
}
